package com.yougou.data.api;

import com.yougou.data.model.response.BaseResponse;
import com.yougou.data.model.response.CategoriesResponse;
import com.yougou.data.model.response.FloorDataResponse;
import com.yougou.data.model.response.GoodsDetailResponse;
import com.yougou.data.model.response.GoodsSearchResponse;
import com.yougou.data.model.response.HomeDataResponse;
import com.yougou.data.model.response.OrderListResponse;
import com.yougou.data.model.response.SwiperResponse;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiService {
    
    
    @GET("api/public/v1/home/swiperdata")
    Observable<SwiperResponse> getSwiperData();
    
    
    @GET("api/public/v1/home/catitems")
    Observable<HomeDataResponse> getCatItems();
    
    
    @GET("api/public/v1/home/floordata")
    Observable<FloorDataResponse> getFloorData();
    
    
    @GET("api/public/v1/categories")
    Observable<CategoriesResponse> getCategories();
    
    
    @GET("api/public/v1/goods/search")
    Observable<GoodsSearchResponse> searchGoods(
        @Query("query") String query,
        @Query("cid") Integer cid,
        @Query("pagenum") int pagenum,
        @Query("pagesize") int pagesize
    );
    
    
    @GET("api/public/v1/goods/detail")
    Observable<GoodsDetailResponse> getGoodsDetail(
        @Query("goods_id") int goodsId
    );
    
    
    @GET("api/public/v1/goods/qsearch")
    Observable<BaseResponse> quickSearch(
        @Query("query") String query
    );
    
    
    @POST("api/public/v1/users/wxlogin")
    Observable<BaseResponse> wxLogin(
        @Query("code") String code
    );
    
    
    @POST("api/public/v1/my/orders/create")
    Observable<BaseResponse> createOrder(
        @Query("order_price") double orderPrice,
        @Query("consignee_addr") String consigneeAddr,
        @Query("goods") String goods
    );
    
    
    @GET("api/public/v1/my/orders/chkOrder")
    Observable<BaseResponse> checkOrder(
        @Query("order_id") String orderId
    );
    
    
    @GET("api/public/v1/my/orders/all")
    Observable<OrderListResponse> getOrders(
        @Query("type") int type
    );
}

